package com.turkcell.dv.rest.dto;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.turkcell.dv.model.UserDOM;

public class UserDTO {
	private long id;
	private String username;
	private String createdBy;
	private Date createdDate;
	private String firstName;
	private String lastName;

	public UserDTO() {
	}

	public UserDTO(int id, String username, String createdBy, Date createdDate) {
		this.id = id;
		this.username = username;
	}

	@JsonProperty
	public long getId() {
		return this.id;
	}

	public void setId(long id) {
		this.id = id;
	}

	@JsonProperty
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@JsonProperty
	public String getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	@JsonProperty
	public Date getCreatedDate() {
		return this.createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	@JsonProperty
	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	@JsonProperty
	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	@Override
	public String toString() {
		return "id=" + id + ", name=" + username + ", createdBy=" + createdBy  + ", createDate=" + createdDate;
	}
	
	public void transformDOM(UserDOM user) {
		this.createdBy = user.getCreatedBy();
		this.createdDate = user.getCreatedDate();
		this.firstName = user.getFirstName();
		this.id = user.getId();
		this.lastName = user.getLastName();
		this.username = user.getUsername();
	}
}
